home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / class / linkseq.c < prev    next >
C/C++ Source or Header  |  1997-04-16  |  2KB  |  96 lines

  1.  
  2.  
  3. /*  Copyright (c) 1993-1996 Algorithms Corporation  */
  4. /*  All rights reserved.  */
  5.  
  6.  
  7.  
  8.  
  9. /*  This file automatically generated by dpp - do not edit  */
  10.  
  11. #define    DPP_STRATEGY    2
  12. #define    DPP_FASTWIDE    0
  13.  
  14.  
  15.  
  16.  
  17. #define    CLASS    LinkSequence_c
  18. #define    ivType    LinkSequence_iv_t
  19.  
  20. #include "generics.h"
  21.  
  22. object    LinkSequence_c;
  23.  
  24.  
  25. #line 26 "linkseq.c"
  26. typedef struct  _LinkSequence_iv_t  {
  27.     object iNext;
  28. }    LinkSequence_iv_t;
  29.  
  30.  
  31.  
  32. #line 20 "linkseq.d"
  33. cmeth objrtn LinkSequence_cm_gNewWithObj(object self, object link)
  34.     object ls; 
  35.     ivType *iv; 
  36.  
  37.     ChkArgNul(link, 2); 
  38.     ls = oSuper(LinkSequence_c, gNew, self)(self); 
  39.     iv = ivPtr(ls); 
  40.     iv->iNext = link; 
  41.     return ls; 
  42.  
  43. imeth objrtn LinkSequence_im_gNext(object self)
  44. { LinkSequence_iv_t *iv = GetIVs(LinkSequence, self);
  45.     object n; 
  46.     if (n = iv->iNext) { 
  47.         iv->iNext = gNext(iv->iNext); 
  48.         return n; 
  49.     } 
  50.     return gDispose(self); 
  51.  
  52.  
  53. #line 57 "linkseq.c"
  54.  
  55. objrtn    LinkSequence_initialize(void)
  56. {
  57.     static  CRITICALSECTION  cs;
  58.     static  int volatile once = 0;
  59.  
  60.     ENTERCRITICALSECTION(_CI_CS_);
  61.     if (!once) {
  62.         INITIALIZECRITICALSECTION(cs);
  63.         once = 1;
  64.     }
  65.     LEAVECRITICALSECTION(_CI_CS_);
  66.  
  67.     ENTERCRITICALSECTION(cs);
  68.  
  69.     if (LinkSequence_c) {
  70.         LEAVECRITICALSECTION(cs);
  71.         return LinkSequence_c;
  72.     }
  73.     INHIBIT_THREADER;
  74.     Sequence_initialize();
  75.     if (LinkSequence_c)  {
  76.         ENABLE_THREADER;
  77.         LEAVECRITICALSECTION(cs);
  78.         return LinkSequence_c;
  79.     }
  80.     LinkSequence_c = gNewClass(Class, "LinkSequence", sizeof(LinkSequence_iv_t), 0, Sequence, END);
  81.     cMethodFor(LinkSequence, gNewWithObj, LinkSequence_cm_gNewWithObj);
  82.     iMethodFor(LinkSequence, gNext, LinkSequence_im_gNext);
  83.  
  84.     ENABLE_THREADER;
  85.  
  86.     LEAVECRITICALSECTION(cs);
  87.  
  88.     return LinkSequence_c;
  89. }
  90.  
  91.  
  92.  
  93.